//评价
$(document).ready(function() {
    var img1src = "upload/01.jpg";
    var img2src = "upload/02.jpg";
    var num = 0
    var timer3 = setInterval(function() {
        var usercomment = $('#usercomment');
        var liss = $('#usercomment li:first');
        liss.remove();
        if (num > 1) {
            num = 0;
        };
        if (num == 0) {
            usercomment.append($("<li><img src=" + img1src + "> 用户对“酸辣土豆丝”评说：味道挺不错，送餐速度挺快... </li>"));
        } else {
            usercomment.append($("<li><img src=" + img2src + "> 用户对“酸辣土豆丝”评说：味道挺不错，送餐速度挺快... </li>"));
        };
        num++;
    }, 3000);
})


//订单信息
window.onload = function() {
    var UpRoll = document.getElementById('UpRoll');
    var li = document.getElementById('UpRoll').getElementsByTagName('li');
    console.log(li);
    var ml = 0;
    var timer1 = setInterval(function() {

        var timer2 = setInterval(function() {
            UpRoll.scrollTop = (++ml);
            if (ml == 1) {
                clearInterval(timer2);
                UpRoll.scrollTop = 0;
                ml = 0;
                li[0].parentNode.appendChild(li[0]);
            }
        }, 10);
    }, 3000);
}

//轮播图
$(document).ready(function() {
    var lis = $("#ulk li");
    var index = 0;

    setInterval(function() {
        if (index > 2) {
            index = 0;
        }
        lis.eq(index).show();
        lis.eq(index).siblings().hide();
        index++
    }, 2000);
})